<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            background-color: #333;
        }
        i{
            position: absolute;
            width: 100%;
            height: 300px;
            background-image: url(../CSS3进阶素材-包含小熊动画/CSS3进阶素材-包含小熊动画/media/bg1.png);
            animation: san 5s linear infinite;
        }
        @keyframes san{
            0%{
                background-position: 0 0;
            }
            100%{
                background-position: -1600px 0;
            }
        }
        div{
            width: 200px;
            height: 100px;
            position: absolute;
            top: 200px;
            background-image: url(../CSS3进阶素材-包含小熊动画/CSS3进阶素材-包含小熊动画/media/bear.png);
            /* 我们元素可以添加多个动画  用逗号分割 */
            animation: bear 0.8s steps(8) infinite,move 3s forwards;
        }
        @keyframes bear{
            0%{
                background-position: 0 0;
            }
            100%{
                background-position: -1600px 0;
            }
        }
        @keyframes move{
            0%{
                left: 0;
            }
            100%{
                left: 50%;
                /* margin-left: -180px; */
                transform: translate(-50%);
            }
        }
    </style>
</head>
<body>
    <i></i>
    <div></div>
</body>
</html>